package p7;

/**
 * @author krystal
 * @date 2022/11/11 14:50
 */
class Date{
    private int year;
    private int month;
    private int day;

    public void setYear(int year){
        this.year=year;
    }

    public int getYear(){
        return this.year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public void setDay(){
        System.out.println("不带参数的构造方法");
    }

}

public class Demo1 {
    public static void main(String[] args) {
        Date d1=new Date();
        d1.setYear(1999);
        d1.setMonth(2);
        d1.setDay(23);
        System.out.println("年份："+d1.getYear()+",月份："+d1.getMonth()+",日："+d1.getDay());
    }
}
